﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Collections.Generic;
using PX.Column;

public partial class SubMasterPage : System.Web.UI.MasterPage
{
	private PX.Column.ColumnComponent clsColumnComp = new PX.Column.ColumnComponent();

	protected void Page_Load(object sender, EventArgs e)
	{
		int nColumnID = 0;
		List<Tony.EntityBase> list = new List<Tony.EntityBase>();

		try
		{
			nColumnID = Convert.ToInt32(Request.QueryString["ColumnID"].ToString());

			list = clsColumnComp.QueryColumn(nColumnID);

			HyperLink aIndex = new HyperLink();

			aIndex.Text = "首页";
			aIndex.NavigateUrl = "Index.aspx";

			labMenu.Controls.Add(aIndex);

			for (int i = 0; i < list.Count; i++)
			{
				Label lab = new Label();
				HyperLink aColumn = new HyperLink();
				PX.Column.Column clsColumn = (PX.Column.Column)list[i];

				lab.Text = "-->";
				aColumn.Text = clsColumn.Name;
				aColumn.NavigateUrl = "Index.aspx";

				labMenu.Controls.Add(lab);
				labMenu.Controls.Add(aColumn);
			}
		}
		catch (Exception ex)
		{
			HyperLink aIndex = new HyperLink();
			Label lab = new Label();
			Label labQuery = new Label();

			aIndex.Text = "首页";
			aIndex.NavigateUrl = "Index.aspx";
			lab.Text = "-->";
			labQuery.Text = "查询结果";

			labMenu.Controls.Add(aIndex);
			labMenu.Controls.Add(lab);
			labMenu.Controls.Add(labQuery);
		}

	}
}
